package com.yami.shop.consign.common.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yami.shop.bean.vo.ConsignRecordVO;
import com.yami.shop.consign.common.model.ConsignRecord;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface ConsignRecordMapper extends BaseMapper<ConsignRecord> {

    /**
     * 根据编码查询商品列表
     * @param nftId
     * @return
     */
    List<ConsignRecordVO> getRecordList(@Param("nftId") String nftId);

    /**
     * 昨日平均价
     * @param prodId
     * @return
     */
    String getYesterdayAvgPrice(@Param("prodId") Integer prodId);

    /**
     * 昨日收盘价
     * @param prodId
     * @return
     */
    ConsignRecord closingPriceByProdId(@Param("prodId") Integer prodId);

    /**
     * 今日最高、低价
     * @param prodId
     * @return
     */
    Map<String, Long> todayExtremePrice(@Param("prodId") Integer prodId);

    /**
     * 本周最高、低价
     * @param prodId
     * @return
     */
    Map<String, Long> weekExtremePrice(@Param("prodId") Integer prodId);


    /**
     * API 添加记录
     *
     * @param consignRecordVO
     */
    void insertVO(ConsignRecordVO consignRecordVO);
}
